#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
int comper(const void* p1, const void* p2)
{
	return *(int*)p1 - *(int*)p2;
}

int lcm(int x, int y)
{
	int a = x, b = y;
while (a%b)
	{
		int m = a % b;
		a = b;
		b = m;
	}
	int t = (x * y) /b;
	return t;
}

int LCM(int x, int y, int z)
{
	int a = x, b = y, c = z;
	int f = lcm(a, b);
	int m = lcm(f, c);
	return m;
}

int S(int H1, int H2, int H3)
{
	int s = H1 * H2 * H3 * (LCM(H1, H2, H3) / (lcm(H1, H2) * lcm(H2, H3) * (H1, H3)));
	return s;
}

int main()
{
	int N = 0;
	int arr[100000];
	scanf("%d", &N);
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &arr[i]);
	}
	qsort(arr, N, sizeof(int), comper);
	int x1=arr[0], x2=arr[1], x3=arr[2];
	int max = S(x1,x2,x3);
	for (int i = 0; i < N - 2; i++)
	{
		for (int j = i + 1; j < N - 1; j++)
		{
			for (int k = j + 1; k < N; k++)
			{
				if (max < S(arr[i], arr[j], arr[k]))
				{
					max = S(arr[i], arr[j], arr[k]);
					x1 = arr[i], x2 = arr[j], x3 = arr[k];
				}
			}
		}

	}
	printf("%d %d %d", x1, x2, x3);
	return 0;
}